package com.example.demo.service;

import com.example.demo.dto.DemoDto;
import org.noear.solon.annotation.Component;
import org.noear.solon.data.annotation.Cache;

/**
 * @author airhead
 */
@Component
public class DemoService {
    public String hello() {
        return "hello plugin.";
    }

    @Cache(key = "demo:cache", tags = "demo")
    public DemoDto cache() {
        System.out.println("get demo from source");
        return DemoDto.builder().id(0L).name("demo").build();
    }
}
